


Page({
  data: {
    currentStatus: 0,
    statuss: [{
      id: 0,
      name: '全部',
    }, {
      id: 1,
      name: '待付款',
    }, {
      id: 2,
      name: '待核销',
    }, {
      id: 3,
      name: '待发货',
    }, {
      id: 4,
      name: '待收货',
    }, {
      id: 5,
      name: '已完成',
    }]
  },

  onLoad: function (options) { 
    this.loadData(options);
  },

  onShow: function() {
    this.loadData(this.options);
  },

  loadData(options) {
    const tabIdx = options.param1 || 0;
      this.setData({
        currentStatus: parseInt(tabIdx)
      });
  },

  // 切换订单状态
  onStatusChange(e) {
    const tabIndex = parseInt(e.currentTarget.dataset.id);
    this.setData({
      currentStatus: tabIndex
    });
  }
});